<html>
<head><meta charset="utf-8"><title>Doc comments highlighting · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html">Doc comments highlighting</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200894385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/200894385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#200894385">(Jun 15 2020 at 14:14)</a>:</h4>
<p>As for me it looks like we lack semantic tokens for punctuation and macros, am I right?</p>
<p><a href="/user_uploads/4715/f-d0-GFhj63yk1tJwwdPXph1/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/f-d0-GFhj63yk1tJwwdPXph1/image.png" title="image.png"><img src="/user_uploads/4715/f-d0-GFhj63yk1tJwwdPXph1/image.png"></a></div>



<a name="200895090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/200895090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#200895090">(Jun 15 2020 at 14:19)</a>:</h4>
<p>I thnk so, yeh</p>



<a name="201262897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201262897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201262897">(Jun 18 2020 at 12:52)</a>:</h4>
<p>Regarding <a href="https://github.com/rust-analyzer/rust-analyzer/pull/4903#issuecomment-645442415">https://github.com/rust-analyzer/rust-analyzer/pull/4903#issuecomment-645442415</a> any thoughts on how to handle the one case I brought up (comments in doc comments are indistinguishable from doc comments if we append <code>documentation</code> to all items in a doctest)? I wanted to explore possible options here.</p>



<a name="201262979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201262979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201262979">(Jun 18 2020 at 12:53)</a>:</h4>
<p>My preference would be to mark them with a <code>doctest</code> modifier instead, but I'm also open to any other ideas. My personal preference is to have the two comments show differently if the code is also going to be highlighted differently.</p>



<a name="201263521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201263521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201263521">(Jun 18 2020 at 12:58)</a>:</h4>
<p>Yeah, I think a separate modifier makes sense. Instead of documentation, we should use something that means "this code is highlihgitng as rust, but is really a comment". Not sure about the right name</p>



<a name="201263531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201263531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201263531">(Jun 18 2020 at 12:58)</a>:</h4>
<p>maybe just "injected"?</p>



<a name="201264020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201264020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201264020">(Jun 18 2020 at 13:02)</a>:</h4>
<p>ok, in that case do you think it makes sense to pull this out, then in a new story do this along with the other item we mentioned? The one about adding the new modifier to the operators and currently unmarked items like <code>=</code> <code>;</code>, etc. (Not sure if something else might get missed).</p>



<a name="201264199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201264199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201264199">(Jun 18 2020 at 13:04)</a>:</h4>
<p>I could go either way there</p>



<a name="201264270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201264270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201264270">(Jun 18 2020 at 13:05)</a>:</h4>
<p>Splitting PRs is always a good idea!</p>



<a name="201264788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201264788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201264788">(Jun 18 2020 at 13:09)</a>:</h4>
<p>ok, will do, then we can bikeshed the modifier in a whole new story :D</p>



<a name="201265487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201265487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201265487">(Jun 18 2020 at 13:14)</a>:</h4>
<p>Just pushed an update for the PR (should be good to go at this point) and created <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4939">https://github.com/rust-analyzer/rust-analyzer/issues/4939</a> to track the new modifier. I'll get started on that right away (I think it should also be entirely independent of the documentation highlighting)</p>



<a name="201268714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Doc%20comments%20highlighting/near/201268714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Doc.20comments.20highlighting.html#201268714">(Jun 18 2020 at 13:39)</a>:</h4>
<p>Ok, new PR is up with the fixes: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/4940">https://github.com/rust-analyzer/rust-analyzer/pull/4940</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>